﻿Public Class sumtwonumbers
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btn_calculate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_calculate.Click
        lbl_sumresult.Text = calculatesum(tb_number1.Text, tb_number2.Text)
    End Sub
    Private Function calculatesum(ByVal number1Str As String, ByVal number2Str As String) As String
        Dim number1, number2 As Decimal
        number1 = CDec(number1Str)
        number2 = CDec(number2Str)
        Dim sumresult As Decimal
        sumresult = number1 + number2
        Return CStr(sumresult)
    End Function
End Class